<?php //change_password.php
require_once('./inc/inc.common.php');
$tmpl 		= new mvTemplate();
$tmpl->page_title('Change Your Password');

if(isset($_POST['password1'])){
	if ( strlen($_POST['password1']) > 4 ) {
		if($_POST['password1'] != $_POST['password2']) {
			mvError::userError('Password Error', 'Your password did not match the confirmed password!');
		}else{
			// all passed changes password
			$_SESSION['user']->change_password($_POST['password1']);
			mvError::userNotice('Password Changed', 'Your password has been changed!');
			header('location: index.php');
			die();
		}
	}else{
		mvError::userError('Password Error', 'Please enter a valid password!');
	}
}

$tmpl->page_display('change_password.tpl');
?>